package net.hn.hnms.biz.mine.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.mine.domain.VideoConfig;
import net.hn.hnms.biz.mine.domain.vo.VideoConfigVo;
import net.hn.hnms.biz.mine.service.IVideoConfigService;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.core.domain.ResponsePage;
import net.hn.hnms.sys.common.core.web.controller.BaseController;
import net.hn.hnms.sys.common.mybatis.core.page.PageQuery;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@RestController
@RequestMapping("config/video")
@Api(value = "视频配置控制器", tags = {"视频配置"})
public class VideoConfigController extends BaseController {

    @Resource
    private IVideoConfigService videoConfigService;

    /**
     * 修改其他生产计划
     */
    @ApiOperation("修改视频配置")
    @SaCheckPermission("config:video:update")
    @PutMapping("/update")
    public R<Void> update(@Validated @RequestBody VideoConfig videoConfig) {
        videoConfigService.updateByCode(videoConfig);
        return R.ok();
    }

    /**
     * 获取重点工作执行
     */
    @ApiOperation("获取分页列表")
    @GetMapping("/page")
    @AutoSetMineCode
    public R<ResponsePage<VideoConfigVo>> page(VideoConfigVo videoConfigVo, PageQuery pageQuery) {
        return R.ok(videoConfigService.selectPageList(videoConfigVo, pageQuery));
    }

}
